<?php /* Template_ 2.2.4 2011/09/28 09:20:06 E:\PHP\www\sagapo\template_\default\admin\member\index.html 000004378 */ 
$TPL_list_1=empty($TPL_VAR["list"])||!is_array($TPL_VAR["list"])?0:count($TPL_VAR["list"]);?>
<h2 class="member">
	회원 관리
	<button type="button" class="add" onclick="move('<?php echo $TPL_VAR["CFG"]->PATH->WWWADMIN?>/member/add')">추가</button>
</h2>
<section class="default">
	<script>
		$(function() {
			$(".table_delete").click(function(){
				if(!confirm("정말로 탈퇴 시키겠습니까?\n탈퇴시 모든 회원의 글, 자료는 삭제됩니다.")) return false;
			});
		});
		
		var mf = new function() {
			this.name ="회원"
			
			,this.auth = function(obj, seq) {
				if(confirm("해당 회원을 인증 하시겠습니까?")) {
					url = "<?php echo $TPL_VAR["CFG"]->PATH->WWWADMIN?>/member/doAuth/"+seq;
					$.ajax({url:url, success:function(data){
						if(data.code == mesg.success) {
							$(obj).text("인증취소").attr("class", "not_auth red").attr("onclick", "").unbind("click").bind("click", function(){
								mf.not_auth($(obj), seq);
							});
						} else {
							alert(data.msg);
						}
					}});
				}
				
				return false;
			}
			
			,this.not_auth = function(obj, seq) {
				if(confirm("해당 회원을 인증취소 하시겠습니까?")) {
					url = "<?php echo $TPL_VAR["CFG"]->PATH->WWWADMIN?>/member/doNotAuth/"+seq;
					
					$.ajax({url:url, success:function(data){
						if(data.code == mesg.success) {
							$(obj).text("인증승인").attr("class", "auth blue").attr("onclick", "").unbind("click").bind("click", function(){
								mf.auth($(obj), seq);
							});
						} else {
							alert(data.msg);
						}
					}});
				}
				
				return false;
			}
			
			,this.password_change = function(seq) {
				ajaxLoad('<?php echo $TPL_VAR["CFG"]->PATH->WWWADMIN?>/member/passwordChange', "seq="+seq, '비밀번호 수정', 400, 220);
			}
		}
	</script>
	<table class="table">
		<caption>
			회원관리
		</caption>
		<colgroup>
			<col class="t_chk" />
			<col class="t_member_id" />
			<col class="t_member_name" />
			<col />
			<col class="t_member_auth" />
			<col class="t_member_pwd_change" />
			<col class="t_etc" />
		</colgroup>
		<thead>
			<tr>
				<th scope="col"><input type="checkbox" name="all_checked" onclick="inputFunction.allChecked(this)" /></th>
				<th scope="col">아이디</th>
				<th scope="col">이름</th>
				<th scope="col">이메일</th>
				<th scope="col">비인증</th>
				<th scope="col">비밀번호변경</th>
				<th scope="col">비고</th>
			</tr>
		</thead>
		<tbody>
<?php if($TPL_VAR["list"]){?>
<?php if($TPL_list_1){foreach($TPL_VAR["list"] as $TPL_V1){?>
			<tr>
				<td class="txt_center"><input type="checkbox" name="chk[]" /></td>
				<td><a href="view/<?php echo $TPL_V1->m_seq?>"><?php echo $TPL_V1->m_id?></a></td>
				<td class="txt_center"><?php echo $TPL_V1->m_name?></td>
				<td><a href="mailto:<?php echo $TPL_V1->m_email?>"><?php echo $TPL_V1->m_email?></a></td>
				<td class="txt_center">
<?php if($TPL_V1->m_auth== 1){?>
						<button type="button" class="not_auth red" onclick="mf.not_auth(this, <?php echo $TPL_V1->m_seq?>)"><?php echo $TPL_V1->auth?></button>
<?php }else{?>
						<button type="button" class="auth blue" onclick="mf.auth(this, <?php echo $TPL_V1->m_seq?>)"><?php echo $TPL_V1->auth?></button>
<?php }?>
				</td>
				<td class="txt_center">
					<button type="button" class="password" onclick="mf.password_change(<?php echo $TPL_V1->m_seq?>)">변경</button>
				</td>
				<td class="txt_center">
					<a href="modify/<?php echo $TPL_V1->m_seq?>">
						<img src="<?php echo $TPL_VAR["CFG"]->PATH->IMAGE?>/icons/pencil.png" alt="수정" />
					</a>
					&nbsp;
<?php if($TPL_V1->m_delete== 1){?>
					<a href="doDelete/<?php echo $TPL_V1->m_seq?>">
						<img src="<?php echo $TPL_VAR["CFG"]->PATH->IMAGE?>/icons/delete.png" alt="삭제" class="table_delete" />
					</a>
<?php }?>
				</td>
			</tr>
<?php }}?>
<?php }else{?>
			<tr>
				<td colspan="7" class="txt_center no_data">
					등록된 기념일이 없습니다. <a href="<?php echo $TPL_VAR["CFG"]->PATH->WWWADMIN?>/member/add" class="icon_add_btn">추가</a>
				</td>
			</tr>
<?php }?>
		</tbody>
	</table>
</section>